import Cookies from 'js-cookie';

/**
 * 获取cookies
 * @param key
 * @returns {string}
 */
export function getCookies(key: string) {
  return Cookies.get(key);
}

/**
 * 设置cookies
 * @param key
 * @param value
 * @param expires 过期时间(秒)
 */
export function setCookiesByExpiresTime(key: string, value: string, expires: number) {
  return Cookies.set(key, value, { expires: expires / 86400 });
}

/**
 * 移除Cookies
 * @param key
 */
export function removeCookies(key: string) {
  return Cookies.remove(key);
} 